// JavaScript Document
	function dateMask(inputData, e){
		if(document.all) // Internet Explorer
		var tecla = event.keyCode;
		else // Outros Browsers
		var tecla = e.which;
		
		if(tecla >= 47 && tecla < 58){ // numeros de 0 a 9 e "/"
		var data = inputData.value;
		if (data.length == 2 || data.length == 5){
		data += '/';
		inputData.value = data;
		}
		}else if(tecla == 8 || tecla == 0) // Backspace, Delete e setas
											// direcionais(para mover o cursor, apenas
											// para FF)
		return true;
		else
		return false;
	}
		
	function mudacordivmenu(isto){
		isto.background = '#000000';
	}
		
	function mudacordivmenureturn(isto){
		isto.background = '#FFFFFF';
	}

	function busca(modulo,pag){
		var valor = document.getElementById("itembusca");
		
		if(pag != ""){
		var pagina = "&pagina="+pag;
		}else{
		var pagina = "";	
		}
		location.href="?modulo="+modulo+"&acao=lista&filtro=" + valor.value  + pagina;
	
	}
	var statusmodify;
	function alterastatusNoticia(id){
		statusmodify = id;
		executar("acao/noticia.php","id="+id+"&acao=status",alterastatusNoticiaReturn);
	}
	
	function alterastatusNoticiaReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = '../imagens/icones/'+xhReq.responseText;
		}
	}
	
	// alterastatusMural
	function alterastatusSintoma(id){
	statusmodify = id;
	executar("acao/sintomas.php?id="+id+"&acao=status","",alterastatusSintomaReturn);
	}


	function alterastatusSintomaReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}

	function alterastatusLinks(id){
	statusmodify = id;
	executar("acao/links.php?id="+id+"&acao=status","",alterastatusLinksReturn);
	}

	function alterastatusLinksReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}

	function alterastatusPergunta(id){
	statusmodify = id;
	executar("acao/perguntas.php?id="+id+"&acao=status","",alterastatusPerguntaReturn);
	}

	function alterastatusPerguntaReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}

	function alterastatusConvenios(id){
	statusmodify = id;
	executar("acao/convenios.php?id="+id+"&acao=status","",alterastatusConveniosReturn);
	}


	function alterastatusConveniosReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}

	function alterastatusCategoria(id){
	statusmodify = id;
	executar("acao/categoria.php?id="+id+"&acao=status","",alterastatusCategoriaReturn);
	}

	function alterastatusCategoriaReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}

	function alterastatusUsuario(id){
	statusmodify = id;
	executar("acao/usuario.php?id="+id+"&acao=status","",alterastatusUsuarioReturn);
	}

	function alterastatusUsuarioReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}

	// alterastatusVideos
	function alterastatusVideos(id){
	statusmodify = id;
	executar("acao/videos.php?id="+id+"&acao=status","",alterastatusVideosReturn);
	}


	function alterastatusVideosReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}

	function alterastatusNews(id){
	statusmodify = id;
	executar("acao/newsletter.php?id="+id+"&acao=status","",alterastatusNewsletterReturn);
	}


	function alterastatusNewsletterReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}
	
	function alteradestaquefoto(id){
		executar("acao/noticia.php?idfoto="+id+"&acao=statusDestaque","",alteradestaquefotoRetorno);
		}
	function alteradestaquefotoRetorno(){

		if(xhReq.readyState==4){
		return true
		}else{
		return false;
		}
		
		}

	// alterastatusPublicidade
	function alterastatusPublicidade(id){
		statusmodify = id;
		executar("acao/publicidade.php?id="+id+"&acao=status","",alterastatusPublicidadeReturn);
	}

	function alterastatusPublicidadeReturn(){
		if(xhReq.readyState==4){
		// alert(xhReq.responseText);
		document.getElementById("img_"+statusmodify).src = "../imagens/icones/" + xhReq.responseText;
		}
	}
	
	function alteralegendaFoto(idfoto,idlegenda){
		var legenda	= document.getElementById(idlegenda).value;
		executar("acao/noticia.php?idfoto="+idfoto+"&acao=trocalegenda&legenda="+legenda,"",alteralegendaFotoRetorno);
	}
	
	function alteralegendaFotoRetorno(){
		if(xhReq.readyState==4){
		alert("Foto salva!");
		}else{
		return false;
		}
	}